package fr.ul.ade.secunde.ui.phone;

import android.os.Bundle;
import android.widget.Toast;

import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;

import fr.ul.ade.R;
import fr.ul.ade.secunde.ui.HelpActionListener;

/**
 * Activité responsable du formulaire de création d'un emploi du temps.
 * 
 * @author Michaël Schnell
 * @since Jul 2, 2013
 * 
 * @version 1.6
 */
public class CreateSchedule
		extends SherlockFragmentActivity
		implements HelpActionListener {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.activity_create_schedule);
		this.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		this.getSupportMenuInflater().inflate(R.menu.create_schedule, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case android.R.id.home:
			this.onBackPressed();
			return true;

		case R.id.action_help:
			this.showHelp();
			return true;

		case R.id.action_qrcode:
			// FIXME Scan d'un QR code
			Toast.makeText(this, "Scan QR code", Toast.LENGTH_SHORT).show();
			return true;

		default:
		}
		return super.onOptionsItemSelected(item);
	}

	@Override
	public void showHelp() {
		// TODO Auto-generated method stub
	}

}// class CreateSchedule